//
//  YPLabel.m
//  yingpa
//
//  Created by 谭亚明 on 2020/3/19.
//  Copyright © 2020 it. All rights reserved.
//

#import "TYMLabel.h"

@implementation TYMLabel

-(void)awakeFromNib{
    [super awakeFromNib];
    if (_textInsets.left > 0) {
       
    }
    //_textInsets = UIEdgeInsetsZero;
}

- (instancetype)init {
    if (self = [super init]) {
        //_textInsets = UIEdgeInsetsZero;
    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        _textInsets = UIEdgeInsetsZero;
    }
    return self;
}

- (void)drawTextInRect:(CGRect)rect {
    [super drawTextInRect:UIEdgeInsetsInsetRect(rect, _textInsets)];
}


+(instancetype)lb_text:(NSString *)text font:(UIFont *)font color:(UIColor *)color{
    TYMLabel *label = [[TYMLabel alloc] init];
    label.textColor = color;
    label.font = font;
    label.text = text;
    return label;
}

@end
